Skip to content

feat: Add support for LlamaCloud EU region#38

Merged
AstraBert merged 6 commits into
run-llama:mainfrom
nick-galluzzo:fix/provide-regional-api-support
Aug 14, 2025
Merged

feat: Add support for LlamaCloud EU region#38
AstraBert merged 6 commits into
run-llama:mainfrom
nick-galluzzo:fix/provide-regional-api-support

Conversation

@nick-galluzzo
Copy link
Copy Markdown
Collaborator

This PR adds support for LlamaCloud's regional API endpoints, allowing users to configure their preferred region (North America or Europe) while maintaining full backward compatibility.

Changes

  • New: src/notebookllama/utils.py - Centralized utility functions for LlamaCloud client creation with regional support
  • New: Regional configuration via LLAMACLOUD_REGION environment variable
  • Updated: All LlamaCloud client instantiation to use new utility functions
  • Added: Error handling with custom LlamaCloudConfigError
  • Added: Unit tests covering regional support scenarios
  • Updated: Documentation in README and .env.example

Configuration

  • North America (default): No configuration needed - works exactly as before
  • Europe: Set LLAMACLOUD_REGION="eu" in your .env file

Backward Compatibility

  • 100% backward compatible - existing code requires no changes
  • Default behavior unchanged - North America region by default
  • Optional feature - users can opt into regional configuration

This addresses the regional support issue discussed in #32

…lity

- Fix AsyncLlamaCloud initialization to use 'token' parameter instead of 'api_key'
- Resolve async event loop conflicts in create_llama_cloud_index.py
- Fix relative import issues by converting to absolute imports with proper sys.path handling
- Centralize regional support logic in utils.py with dedicated client creation functions
- Eliminate DRY violations by removing duplicated base_url handling across files
- Improve maintainability with consistent parameter handling and import patterns
- Add proper error handling for async operations within existing event loops
- Ensure create_llamacloud_index is never passes `None` for `api_key` and `pipeline_id`
@AstraBert AstraBert merged commit fbae029 into run-llama:main Aug 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants